
/*
 * @Descripttion:资产盘点 接口API
 * @Author:JDW
 * @version:
 */
import { requestUrl } from '@/common/util/request.ts';


/***
 * @function 分页查询列表
 * @params 请求参数
 */
export function assetCheckList(params:{}) {
	return requestUrl({
		url: `/app-assetcheck/check-store/list`,
		data: params,
		method: 'get',
		keyWord: 'assets',
		isJson: false
	})
}
// 获取盘点状态
export function getAllEnum(enumkeys: string) {
	return requestUrl({
		url: `/enums/${enumkeys}`,
		data: '',
		method: 'get',
		keyWord: 'assets',
		isJson: false
	})
}
// 获取详情资产列表
export function assetCheckSubList(checkStoreId:string,param:{}) {
	return requestUrl({
		url: `/app-assetcheck/check-store/${checkStoreId}`,
		data: param,
		method: 'get',
		keyWord: 'assets',
		isJson: false
	})
}
// 详情页修改数据
export function updateAssetCheck(params:{}) {
	return requestUrl({
		url: `/app-assetcheck/check-store/dtl`,
		data: params,
		method: 'put',
		keyWord: 'assets',
		isJson: true
	})
}
// 某次门店盘点主要信息
export function checkStoreInfo(checkStoreId:string) {
	return requestUrl({
		url: `/app-assetcheck/check-store-info/${checkStoreId}`,
		data: '',
		method: 'get',
		keyWord: 'assets',
		isJson: false
	})
}
// 获取盘点名称
export function checkNameList() {
	return requestUrl({
		url: `/app-assetcheck/check-name/list`,
		data: '',
		method: 'get',
		keyWord: 'assets',
		isJson: false
	})
}
// 获取资产名称
export function assetNameList(checkStoreId:string) {
	return requestUrl({
		url: `/app-assetcheck/ckstore-asset-name/list/${checkStoreId}`,
		data: '',
		method: 'get',
		keyWord: 'assets',
		isJson: false
	})
}
// 结束盘点
export function endCheck(params:{}) {
	return requestUrl({
		url: `/assetCheck/check-store/end-inventory`,
		data: params,
		method: 'put',
		keyWord: 'assets',
		isJson: true
	})
}

// 旧
// 获取资产详情
export function getAssetDetail(params:{}) {
	return requestUrl({
		url: `/asset`,
		data: params,
		method: 'get',
		keyWord: 'assets',
		isJson: false
	})
}
// 确认盘点
export function confirmCheck(params:{},checkStoreId:string,checkStoreVersion:string) {
	return requestUrl({
		url: `/assetCheck/check-store/mobile/inventory?checkStoreId=${checkStoreId}&checkStoreVersion=${checkStoreVersion}`,
		data: params,
		method: 'put',
		keyWord: 'assets',
		isJson: true
	})
}
// 盘点结果
export function getAssetCount(params:{}) {
	return requestUrl({
		url: `/assetCheck/check-store/count`,
		data: params,
		method: 'get',
		keyWord: 'assets',
		isJson: false
	})
}
export function getAssetResultList(params:any) {
	return requestUrl({
		url: `/assetCheck/check-store/dtl`,
		data: params,
		method: 'get',
		keyWord: 'assets',
		isJson: false
	})
}
export function endCheck_api(params:[],assetCheckId:string,assetCheckVersion:string) {
	return requestUrl({
		url: `/assetCheck/check-store/end-inventory?assetCheckId=${assetCheckId}&assetCheckVersion=${assetCheckVersion}`,
		data: params,
		method: 'put',
		keyWord: 'assets',
		isJson: true
	})
}
// 删除
export function delDtl(params:any) {
	return requestUrl({
		url: `/assetCheck/check-store/dtl`,
		data: params,
		method: 'put',
		keyWord: 'assets',
		isJson: true
	})
}


